projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ed52ea5
)
mmc: sdhci: Check that ops are defined
author
Ramon Fried
<
[email protected]
>
Mon, 14 May 2018 12:02:30 +0000
(15:02 +0300)
committer
Tom Rini
<
[email protected]
>
Tue, 15 May 2018 01:28:38 +0000
(21:28 -0400)
The check is necessary to avoid NULL pointer dereference.
Signed-off-by: Ramon Fried <
[email protected]
>
Reviewed-by: Michal Simek <
[email protected]
>
drivers/mmc/sdhci.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/sdhci.c
b/drivers/mmc/sdhci.c
index 8971a1122c932dd6011cd9fc75463e610452d4d4..400f87e134dc26a52554c71a77c5619531167004 100644
(file)
--- a/
drivers/mmc/sdhci.c
+++ b/
drivers/mmc/sdhci.c
@@
-314,7
+314,7
@@
static int sdhci_execute_tuning(struct udevice *dev, uint opcode)
debug("%s\n", __func__);
- if (host->ops->platform_execute_tuning) {
+ if (host->ops
&& host->ops
->platform_execute_tuning) {
err = host->ops->platform_execute_tuning(mmc, opcode);
if (err)
return err;
@@
-347,7
+347,7
@@
static int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
if (clock == 0)
return 0;
- if (host->ops->set_delay)
+ if (host->ops
&& host->ops
->set_delay)
host->ops->set_delay(host);
if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {